/**
 * Copyright &copy; 2012-2014 nplus1 All rights reserved.
 */
package com.gamma.nplus1.modules.sys.entity;

import java.util.List;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.gamma.nplus1.common.persistence.TreeEntity;

/**
 * 机构Entity
 * @author ThinkGem
 * @version 2013-05-15
 */
public class Office extends TreeEntity<Office> {

    private static final long serialVersionUID = 1L;

    //	private Office parent;	// 父级编号
    //	private String parentIds; // 所有父级编号
    private Area area; // 归属区域

    private String code; // 机构编码

    private String name; // 机构名称

    private String enname; //英文名称 add

    private String category; //机构类别 （1：海外仓 2：FTZ 3:买家 4：卖家 5：运营管理）add

    private String type; // 机构类型（1：公司；2：部门；3：小组）

    private String grade; // 机构等级（1：一级；2：二级；3：三级；4：四级）

    private String address; // 个人联系地址

    private String zipCode; // 邮政编码

    private String master; // 用于 个人联系人名称

    private String phone; // 个人电话

    private String fax; // 用于 个人手机号

    private String email; // 个人邮箱

    private String useable;//是否可用

    private User primaryPerson;//主负责人

    private User deputyPerson;//副负责人

    private List<String> childDeptList;//快速添加子部门
    
    private String userGrade;//用户等级
    
    private String website; //企业网站 add
    
    private String businessType; //经营类型 add
    
    private String officeEmail; //企业邮箱 add
    
    private String officeAddress; //企业地址 add
    
    private String officePhone;//机构电话add

    private String workHours; //工作时间 add
    
    private String longitude;//经度 海外仓用
    
    private String latitude;//纬度
    
    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname;
    }

    public String getWorkHours() {
        return workHours;
    }

    public void setWorkHours(String workHours) {
        this.workHours = workHours;
    }


    public Office() {
        super();
        //		this.sort = 30;
        this.type = "2";
    }

    public Office(String id) {
        super(id);
    }

    public List<String> getChildDeptList() {
        return childDeptList;
    }

    public void setChildDeptList(List<String> childDeptList) {
        this.childDeptList = childDeptList;
    }

    public String getUseable() {
        return useable;
    }

    public void setUseable(String useable) {
        this.useable = useable;
    }

    public User getPrimaryPerson() {
        return primaryPerson;
    }

    public void setPrimaryPerson(User primaryPerson) {
        this.primaryPerson = primaryPerson;
    }

    public User getDeputyPerson() {
        return deputyPerson;
    }

    public void setDeputyPerson(User deputyPerson) {
        this.deputyPerson = deputyPerson;
    }

    //	@JsonBackReference
    //	@NotNull
    public Office getParent() {
        return parent;
    }

    public void setParent(Office parent) {
        this.parent = parent;
    }
    //
    //	@Length(min=1, max=2000)
    //	public String getParentIds() {
    //		return parentIds;
    //	}
    //
    //	public void setParentIds(String parentIds) {
    //		this.parentIds = parentIds;
    //	}

    @NotNull
    public Area getArea() {
        return area;
    }

    public void setArea(Area area) {
        this.area = area;
    }
    //
    //	@Length(min=1, max=100)
    //	public String getName() {
    //		return name;
    //	}
    //
    //	public void setName(String name) {
    //		this.name = name;
    //	}
    //
    //	public Integer getSort() {
    //		return sort;
    //	}
    //
    //	public void setSort(Integer sort) {
    //		this.sort = sort;
    //	}

    @Length(min = 1, max = 1)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Length(min = 1, max = 1)
    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    @Length(min = 0, max = 255)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Length(min = 0, max = 100)
    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    @Length(min = 0, max = 100)
    public String getMaster() {
        return master;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    @Length(min = 0, max = 200)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Length(min = 0, max = 200)
    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    @Length(min = 0, max = 200)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Length(min = 0, max = 100)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    //	public String getParentId() {
    //		return parent != null && parent.getId() != null ? parent.getId() : "0";
    //	}

    @Override
    public String toString() {
        return name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getOfficePhone() {
        return officePhone;
    }

    public void setOfficePhone(String officePhone) {
        this.officePhone = officePhone;
    }

    public String getUserGrade() {
        return userGrade;
    }

    public void setUserGrade(String userGrade) {
        this.userGrade = userGrade;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getOfficeEmail() {
        return officeEmail;
    }

    public void setOfficeEmail(String officeEmail) {
        this.officeEmail = officeEmail;
    }

    public String getOfficeAddress() {
        return officeAddress;
    }

    public void setOfficeAddress(String officeAddress) {
        this.officeAddress = officeAddress;
    }

}